package com.hmkj.core.api.juhe.bean.epay;

/**
 * Description: 双乾扫码支付返回结果状态
 * Created by shiyaxiang on 2017/2/25 14:59.
 */
public enum ResultState {

    SUCCESS(0, "失败"),
    ORDER_NO_ERR(1, "成功"),
    REPEAT_IP(2, "待处理"),
    REPEAT_COOKIE(3, "取消"),
    NOT_EXISTS_MERNO(4, "结果未返回");

    private int state;

    private String stateinfo;

    ResultState(int state , String stateinfo){
        this.state = state;
        this.stateinfo = stateinfo;
    }

    public int getState(){
        return state;
    }

    public String getStateinfo(){
        return stateinfo;
    }

    public static ResultState stateOf(int index){
        for (ResultState state : values()) {
            if(state.getState() == index){
                return state;
            }
        }
        return null;
    }
}
